package com.example.demo.controller;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

/**
 * 基本控制器
 *
 * @author yzh
 * @date 2023/01/16
 */
public class BaseController {


    public String getPara(String name) {
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        /*System.out.println(this.request.getParameter("json"));*/
        return request.getParameter(name);
    }
}
